package com.malguy.controllers;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author malguy-wang sir
 * @create ${year}-${month}-${day}-${time}
 */
@org.springframework.stereotype.Controller("/hello")
public class helloController implements Controller {
    /**
     * @param request  前端发送过来的请求
     * @param response     服务端给前端的响应
     * @return
     * @ModelAndView  model 数据模型 ，view 视图
     */
    @Override
    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
                ModelAndView view = new ModelAndView("hello");
                view.addObject("name","bonjour");
                return view;
    }
}
